Repository navigation
certificate create: default CA-profile keys (root-ca, intermediate-ca… - #1747
Closed
reservoir-cmyk wants to merge 1 commit into
Closed
reservoir-cmyk wants to merge 1 commit into
reservoir-cmyk wants to merge 1 commit into
Conversation
|
|
1 similar comment
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Opening this as a draft PR. It is the CLI-side companion to smallstep/certificates#2869, where the corresponding question for
step ca initis being discussed; happy to adjust or close this depending on the direction taken there.What this changes, and what it deliberately does not
utils.DefaultECCurveis "P-256", and it is shared by every flow that resolves key details throughGetKeyDetailsFromCLI: leaf certificates, CSRs, SSH certificates, generic key pairs, and CA keys alike. Changing that shared default to P-384 would move all of those at once, and most of them are not CA keys — the collateral change is larger than the motivation. So this PR does not touch the shared default.Instead, it makes one individual, concrete change: when
step certificate creategenerates a key for theroot-caorintermediate-caprofile — the two profiles whose whole purpose is creating a CA key — and no curve was explicitly requested, the key defaults to P-384 (utils.DefaultECCurveForCA). The root-creation help example is updated to match; the leaf and CSR examples still say P-256, because for them that is still true.Three files, +13/−1: the new constant, the profile check in
parseOrCreateKey, and the one help example.Behaviour, measured with the built binary
--profile root-ca(nothing specified): P-384--profile intermediate-ca(nothing specified): P-384--profile root-ca --kty EC --curve P-256: P-256 — an explicit request is always honoured--profile root-ca --kty RSA: RSA 2048, unaffectedstep crypto keypair(nothing specified): P-256, unchangedTests
go build ./...passes;go veton the touched packages is clean.go test ./utils/... ./command/certificate/... ./command/ca/... ./command/crypto/... ./command/ssh/...passes (same package set as the pre-change baseline).Open point
Whether CA keys should get a different default at all is the question in the companion Issue; this draft only demonstrates the narrowest form of the change, scoped so that nothing outside CA-key creation moves.